<template>
  <div>
    <fuck
      v-for="(obj, index) in arr"
      :key="index"
      :imgurl="obj.dogImgUrl"
      :dogname="obj.dogName"
      :like="feave"
    >
    </fuck>
    <br />
    <p>like Dog:</p>
    <ul>
      <li v-for="(item, index) in liker" :key="index">
        {{ item }}
      </li>
    </ul>
  </div>
</template>

<script>
import fuck from "./components/DOG.vue";
export default {
  data() {
    return {
      liker: [],
      // 1. 准备数据
      arr: [
        {
          dogImgUrl:
            "https://img04.sogoucdn.com/app/a/100520093/e18d20c94006dfe0-7524faeb6c8ff751-4517d7b51a0f7063e2fd3649d886224a.jpg",
          dogName: "博美",
        },
        {
          dogImgUrl:
            "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1224576619,1307855467&fm=26&gp=0.jpg",
          dogName: "泰迪",
        },
        {
          dogImgUrl:
            "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2967740259,1518632757&fm=26&gp=0.jpg",
          dogName: "金毛",
        },
        {
          dogImgUrl:
            "http://img03.sogoucdn.com/app/a/100520021/90B3CAED04C20475037E9580EDAA1F19",
          dogName: "哈士奇",
        },
        {
          dogImgUrl:
            "http://img03.sogoucdn.com/app/a/100520021/6874E7A807515042FAE69C77DA795D0A",
          dogName: "阿拉斯加",
        },
        {
          dogImgUrl: "https://i01piccdn.sogoucdn.com/e1cc1359d0e02ccc",
          dogName: "萨摩耶",
        },
      ],
    };
  },
  components: {
    fuck,
  },
  methods: {
    feave(dogName) {
      this.liker.push(dogName);
    },
  },
};
</script>
<style>
div {
  float: left;
}
</style>

